<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="sj" tagdir="/WEB-INF/tags/spring-jquery-tags"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<link href="<c:url value='/css/tablesorter.css' />" rel="stylesheet" type="text/css"/>
<link href="<c:url value='/css/dhtmlxcombo_view.css' />" rel="stylesheet" type="text/css"/>
<script type="text/javascript">
	$(document).ready(function() {
	
		$('.edit-donoraward-link').click(function() {
			loadDiv('content', 'showEditDonoraward.do?id=' + $(this).attr('donorawardId'));
		});
	 	//$(".tablesorter").tablesorter();	
	
		$('#pageTitle').text('<spring:message code="findDonoraward.heading" />');
		
		 $('#loginFormSubmit').click(function() {		
		  var v1= $('#donorAwardNumber').val();
		  var v2= $('.dhx_combo_input:eq(0)').val();
		//  $('input:password').val();
		 var v3 = $('.dhx_combo_input:eq(1)').val();
		  // alert(v3);
		 if(v1!='' || v2!='' || v3!=''){		    
		    return true;
		  }
		 alert("Please enter at least one filter criteria");
		 return false;
		});
		
		$("#editDonorForm").validate({
			rules : {
				name : {
					required : true
				}
			}
		});
		
		
	});
	
	$('.close-button').click(function() {
		loadDiv('content', 'refreshDashboard.do');
     });
    
     $('#reset').click(function(){
     	// $("donorAwardNumber").val("");      
     	}     
     );
    	var z = dhtmlXComboFromSelect("donor_id");
		z.enableFilteringMode(true);
		
		var z1 = dhtmlXComboFromSelect("donorawardstatus_id");
		z1.enableFilteringMode(true);
     /*
     $('#check-all').click(function() {    
       var checkBox = $('#donorgrid input:checkbox');
       for(var i = 0; i < checkBox.length; i++) {
    	   checkBox[i].checked = this.checked;
       }
	});
    */
</script>
<div id="findDonorDiv">
	<form:form name="editDonorawardForm" id="editDonorawardForm" action="findsearchDonoraward.do" method="GET" modelAttribute="donoraward">
		<form:hidden path="id" />
		<div class="main_form">
			<div class="form_head">
	    		<a href="#" class="close-button gray_btn floatR" tabindex="-1">Close Form</a><br class="clear" />
	    	</div>
	    	<div class="form_cont">
				<table cellspacing="5" width="100%">		
					<tr class="row">
						<td class="input-field" colspan="3">
							<%@ include file="/common/messages.jsp" %>
						</td>
					</tr>
					<tr class="row">
						<td class="label"><spring:message code="editDonoraward.label.donorAwardNumber" /></td>
						<td class="input-field">
							<form:input path="donorAwardNumber" cssClass="input-full-width text_white" />
							<form:errors path="donorAwardNumber" cssClass="error" />
						</td>
						<td width="50">&nbsp;</td>
					</tr>					
					<tr class="row">
						<td class="label"><spring:message code="editDonoraward.label.donor" /></td>
						<td class="input-field">
							<form:select path="donor.id" cssClass="text_white" id="donor_id">
								<form:option value="" label="" />
								<form:options items="${donorList}" itemValue="id" itemLabel="donorName" />
							</form:select></td>
							<form:errors path="donor.id" cssClass="error" />
						</td>
						<td width="50">&nbsp;</td>
					</tr>
					<tr class="row">
						<td class="label">Status</td>
						<td class="input-field">
							<form:select path="donorawardstatus.id" cssClass="text_white" id="donorawardstatus_id">
								<form:option value="" label="" />
								<form:options items="${donorawardstatusList}" itemValue="id" itemLabel="displayName" />
							</form:select></td>
							<form:errors path="donor.id" cssClass="error" />
						</td>
						<td width="50">&nbsp;</td>
					</tr>
					
					<tr class="row">
						<td class="input-field" align="center" colspan="3">
							<sj:submit id="loginFormSubmit" name="loginFormSubmit" cssClass="blue_btn" target="donorAwardSearch" key="findDonoraward.button.search" validate="true" tabindex="-1"/>
							<input type="reset" class="blue_btn" id="reset" value="<spring:message code='button.resetSearch' />"  tabindex="-1"/>
						</td>
					</tr>
				</table>
                
				<div id="donorAwardSearch" class="hastable" style="overflow: auto">
          <c:if test="${!empty initiateSearch }">
  				  <%@ include file="/WEB-INF/jsps/searchResultfindDonoraward.jsp" %>
            </c:if>
				</div>
                
			</div>
		</div>
	</form:form>